package com.ywgt.cas;

import java.util.concurrent.atomic.AtomicInteger;

public class CASTest {
    public static void main(String[] args) {
        AtomicInteger atomicInteger=new AtomicInteger(100);//初始值

        System.out.println(atomicInteger.compareAndSet(100, 2000));//期望值 和 修改值

        System.out.println(atomicInteger.get());

    }
}
